package com.design.cjm.behavioral.Iterator.example1;

/**
 * @Author: Jie Ming Chen
 * @Date: 2019-04-07
 * @Version 1.0
 */
public class ConcreteAggregate implements Aggregate{

    private Integer[] items;

    public ConcreteAggregate() {
        items = new Integer[10];
        for (int i = 0; i < items.length; i++) {
            items[i] = i;
        }
    }

    @Override
    public Iterator<Integer> createIterator() {
        return new ConcreteIterator(items);
    }
}
